<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
  <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
</head>
<body style="padding:10px;">
  <div class="tplay-body-div">
    <div style="margin-top: 20px;">
    </div>
    <form class="layui-form serch" action="{:url('admin/louhao/huzhu_sear')}" method="post">
      <input type="hidden" name="id" value="{$id}">
      <div class="layui-form-item" style="float: left;">
        <div class="layui-input-inline">
          <input type="text" name="keywords" lay-verify="title" autocomplete="off" placeholder="请输入关键词" class="layui-input layui-btn-sm">
        </div>
        <button class="layui-btn layui-btn-danger layui-btn-sm" lay-submit="" lay-filter="serch">立即提交</button>
      </div>
    </form>
      <table class="layui-table" lay-size="lg">
      <tbody>
       
        {volist name="huzhu" id="vo"}
        
          <tr>
            <td>{$key+1}</td>
            <td>{$vo.name}</td>
            <td style="color: red;">{$vo.statusAA}</td>
            <td>
              <a href="{:url('admin/louhao/huzhu_add',['id'=>$vo.id,'lid'=>$id])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i>添加</a>

              <a href="{:url('admin/louhao/huzhu_del',['id'=>$vo.id,'lid'=>$id])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i>取消</a>
            </td>
          </tr>
        {/volist}
      </tbody>
      </table>
    <script src="__PUBLIC__/layui/layui.js"></script>
    <script src="__PUBLIC__/jquery/jquery.min.js"></script>
    <script>
        var message;
        layui.config({
            base: '__JS__/',
            version: '1.0.1'
        }).use(['app', 'message'], function() {
            var app = layui.app,
                $ = layui.jquery,
                layer = layui.layer;
            //将message设置为全局以便子页面调用
            message = layui.message;
            //主入口
            app.set({
                type: 'iframe'
            }).init();
        });
    </script>
    <script>
      layui.use(['layer', 'form'], function() {
          var layer = layui.layer,
              $ = layui.jquery,
              form = layui.form;
          $(window).on('load', function() {
              form.on('submit(admin)', function(data) {
                  $.ajax({
                      url:"{:url('admin/louhao/louhao_add')}",
                      data:$('#admin').serialize(),
                      type:'post',
                      async: false,
                      success:function(res) {
                        if(res.code == 1) {
                            layer.alert('提交成功！',{icon:6},window.location.href = "{:url('admin/louhao/index')}");
                        }else {
                            layer.msg(res.msg);
                        }
                      }
                  })
                  return false;
              });
          });
      });
    </script>
  </div>
</body>
</html>